#pragma once

#pragma pack(1)

struct WDTHeader
{
	ui32 flags;
	ui32 bullshit;
	ui32 unused[6];
};

struct MHDR
{
	ui32 flags;
	ui32 ofsMCIN;
	ui32 ofsMTEX;
	ui32 ofsMMDX;
	ui32 ofsMMID;
	ui32 ofsMWMO;
	ui32 ofsMWID;
	ui32 ofsMDDF;
	ui32 ofsMODF;
	ui32 ofsMFBO;
	ui32 ofsMH2O;
	ui32 ofsMTFX;
	ui32 unnec[4];
};

struct ADTMapChunk
{
	ui32 offset;
	ui32 size;
	ui32 unused1;
	ui32 unused2;
};

struct MDDF
{
	ui32 nameOffset;
	ui32 uniqueId;
	float position[3];
	float rotation[3];
	ui16 scaleFactor;
	ui16 flags;
};

struct MODF
{
	ui32 nameOffset;
	ui32 uniqueId;
	float position[3];
	float rotation[3];
	float upperExt[3];
	float lowerExt[3];
	ui16 flags;
	ui16 doodadSet;
	ui16 unk[2];
};

struct MCLY
{
	ui32 textureId;
	ui32 flags;
	ui32 ofs;
	i16 effect;
	i16 padding;
};

struct SoundEmitter
{
	ui32 soundRef;
	float position[3];
	float scale[3];
};

struct MCNKHDR
{
	ui32 flags;
	ui32 indexX;
	ui32 indexY;
	ui32 nLayers;
	ui32 nDoodadrefs;
	ui32 ofsHeights;
	ui32 ofsNormals;
	ui32 ofsLayers;
	ui32 ofsRefs;
	ui32 ofsAlpha;
	ui32 sizeAlpha;
	ui32 ofsShadow;
	ui32 sizeShadow;
	ui32 areaId;
	ui32 nWmoRefs;
	ui32 holes;
	ui32 unused[4];
	ui32 predText;
	ui32 noEffectDoodad;
	ui32 ofsEmitters;
	ui32 nEmitters;
	ui32 ofsLiquid;
	ui32 sizeLiquid;
	float chunkpos[3];
	ui32 ofsMCCV;
	ui32 unused2;
	ui32 unused3;
};

struct TileTexLayer
{
	ui32 texOffset;
	ui32 flags;
	ui32 ofsAlpha;
	i16 effectId;
	i16 pad;
};

struct ADTDoodadEntry
{
	std::string modelName;
	MDDF doodadPlacement;
	ui32 instanceEntry;
};

#pragma pack()